-
Notifications
You must be signed in to change notification settings - Fork 36
Add prose for exiting a CAUGHTadm block. #227
Conversation
Also slightly changed notation to match the [formal overview document](https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions-formal-overview.md).
1. Let :math:`\val^\ast` be the values on the top of the stack. | ||
|
||
2. Pop the values :math:`\val^\ast` from the stack. | ||
|
||
3. Assert: due to :ref:`validation <valid-instr-seq>`, an administrative instruction :math:`\CAUGHTadm\{a~\val_0^\ast\}` is now on the top of the stack. | ||
|
||
4. Pop the |CAUGHTadm| from the stack. | ||
|
||
5. Push :math:`\val^\ast` back to the stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other similar sections ('Exiting an exception handler' and 'Exiting instr
with label L
') use val^m
. Is there any reason we use val^*
here? For example, our 'Exiting an exception handler' section's prose is:
Exiting an exception handler
............................
When the end of a :ref:`try <syntax-try>` instruction is reached without a jump, exception, or trap, then the following steps are performed.
1. Let :math:`m` be the number of values on the top of the stack.
2. Pop the values :math:`\val^m` from the stack.
3. Assert: due to :ref:`validation <valid-instr-seq>`, the handler :math:`H` is now on the top of the stack.
4. Pop the handler from the stack.
5. Push :math:`\val^m` back to the stack.
6. Jump to the position after the |END| of the administrative instruction associated with the handler :math:`H`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aheejin "Exiting instr with label L" uses val^m
because it's relevant to the rule, in that labels are of the form label_m
. Since caught
does not have such a subscript, I used *
, and I think it should be the same for "Exiting an exception handler".
So I would be more inclined to change to val^*
in "Exiting an exception handler" and leaving this val*
here as it is, but I would go with whatever you prefer. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I see, thanks for the explanation!
@@ -3039,17 +3039,32 @@ Throwing an exception with :ref:`tag address <syntax-tagaddr>` :math:`a` | |||
|
|||
.. _exec-caughtadm: | |||
|
|||
Holding a caught exception with |CAUGHTadm| | |||
........................................... | |||
Exiting a |CAUGHTadm| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exiting a |CAUGHTadm| | |
Exiting a catch clause |CAUGHTadm| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made PR #240 with this and the other changes requested.
Exiting a |CAUGHTadm| | ||
..................... | ||
|
||
When the |END| of a |CAUGHTadm|, is reached without a jump, exception, or trap, then the following steps are performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the |END| of a |CAUGHTadm|, is reached without a jump, exception, or trap, then the following steps are performed. | |
When the |END| of a catch clause |CAUGHTadm| is reached without a jump, exception, or trap, then the following steps are performed. |
|
||
3. Assert: due to :ref:`validation <valid-instr-seq>`, an administrative instruction :math:`\CAUGHTadm\{a~\val_0^\ast\}` is now on the top of the stack. | ||
|
||
4. Pop the |CAUGHTadm| from the stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. Pop the |CAUGHTadm| from the stack. | |
4. Pop the catch clause |CAUGHTadm| from the stack. |
that were made after that PR was merged. In particular the following three comments are addressed. - WebAssembly#227 (comment) - WebAssembly#227 (comment) - WebAssembly#227 (comment)
In particular the following three comments are addressed. - #227 (comment) - #227 (comment) - #227 (comment) - rephrasing "|CAUGHTadm| instruction" to "catch clause".
Also slightly changed notation to match the formal overview document.